﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;

namespace Mindfor.Web.Routing
{
	/// <summary>
	/// Contains information about UrlRoute attributes.
	/// </summary>
	public class UrlRouteInfo
	{
		/// <summary>
		/// Gets or sets route name.
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// Gets or sets relative path.
		/// </summary>
		public string Path { get; set; }

		/// <summary>
		/// Gets or sets sub path.
		/// Sub path is added after main path.
		/// </summary>
		public string SubPath { get; set; }

		/// <summary>
		/// Gets or sets route defaults.
		/// </summary>
		public RouteValueDictionary Defaults { get; set; }

		/// <summary>
		/// Gets or sets route constraints.
		/// </summary>
		public RouteValueDictionary Constraints { get; set; }

		/// <summary>
		/// Initializes new instance.
		/// </summary>
		public UrlRouteInfo()
		{
			Defaults = new RouteValueDictionary();
			Constraints = new RouteValueDictionary();
		}

		/// <summary>
		/// Initializes new instance.
		/// </summary>
		/// <param name="name">Route name.</param>
		/// <param name="path">Relative path.</param>
		/// <param name="subPath">Sub path that added after main path.</param>
		public UrlRouteInfo(string name, string path, string subPath)
		{
			Name = name;
			Path = path;
			SubPath = subPath;
			Defaults = new RouteValueDictionary();
			Constraints = new RouteValueDictionary();
		}
	}
}
